iconCenteringValue = ( ( largerOfTextOrIconWidth - kWidthOfIcon ) / 2 ); /* So we can base textCStringDestinationRect on a iconDestinationRect in case it is altered externally by force. */
iconDestinationRect.left = horizontal + iconCenteringValue; /* Center the icon horizontally */
StringPtr pointerToSourcePascalString; Original Pascal string which you want copied into pointerToDestinationCString.
This string is NOT altered in any way by this routine.
Pass nil to make an empty (0x00 terminated) pointerToDestinationCString. (no bombs!)
unsigned long copyNoMoreThanThisManyCharacters; A maximum limit to the number of characters you’ll allow
pointerToDestinationCString to contain. Always 1 less than allocated
memory!
Pass 0 to make an empty (0x00 terminated) pointerToDestinationCString.
returns nothing.
* This routine does NOT move memory *
96/01/11 v1.0.0 David Cook First version
*/
Byte numberOfCharactersRemainingToBeCopied;
if ( pointerToDestinationCString != nil ) /* Is there a destination string to copy to? */
{
if ( pointerToSourcePascalString != nil && copyNoMoreThanThisManyCharacters > 0 ) /* Is there a source string and do we want to copy any characters? */
/* If our top is over the top margin of the screen, but our bottom is still partially on the main screen, take us all the way over the top of the screen */